package cn.lasse.design;

import cn.lasse.design.bank.IBank;
import cn.lasse.design.bank.service.AmericanService;
import cn.lasse.design.bank.service.JapanService;
import cn.lasse.design.bank.service.KoreaService;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class BankFactory {

    public IBank bank(Integer type) {
        // 按照不同类型方法商品[1美元、2韩元、3日元]
        if (type == 1) {
            return new AmericanService();
        }
        if (type == 2) {
            return new KoreaService();
        }
        if (type == 3) {
            return new JapanService();
        }
        throw new RuntimeException("该银行没合作");
    }
}
